const express = require('express');
const cors = require('cors')
const app = express();
// 解决跨域问题cors中间件
app.use(cors({
    origin: ["http://127.0.0.1:8080", "http://localhost:8080"]
}));
app.listen(8888, () => {
    console.log('server is running...')
});
app.get('/getdata', (req, res) => {
    let obj = [
        { id: 1, productName: '海信（Hisense）60E3F 60英寸 4K超高清', salePrice: 1969 },
        { id: 5, productName: '华为（Huawei）60E3F 60英寸 3K超高清', salePrice: 2969 },
        { id: 2, productName: '惠普 VIDAA 43V1F-R 43英寸 全高清 海信', salePrice: 1049 },
        { id: 3, productName: 'JBI 4k智能网络75 英寸液晶电视机85 90', salePrice: 12999 },
        { id: 6, productName: '75寸液晶电视.....', salePrice: 12012 }
    ]
    res.send(obj);
})